﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;

namespace Common
{
    public class TinTuc
    {
        public int iTinTuc_ID { get; set; }
        public string sTieuDe { get; set; }
        public string sMoTa { get; set; }
        public string sNoiDung { get; set; }
        public string sHinhDaiDien { get; set; }
        public bool bTrangChu { get; set; }
        public bool bQuanLy { get; set; }

        public TinTuc()
        {

        }
        public TinTuc(SqlDataReader reader)
        {
            if (reader != null && !reader.IsClosed && reader.Read())
            {
                if (!reader.IsDBNull(0)) this.iTinTuc_ID = Convert.ToInt32(reader["iTinTuc_ID"]);
                if (!reader.IsDBNull(1)) this.sTieuDe = reader["sTieuDe"].ToString();
                if (!reader.IsDBNull(2)) this.sMoTa = reader["sMoTa"].ToString();
                if (!reader.IsDBNull(3)) this.sNoiDung = reader["sNoiDung"].ToString();
                if (!reader.IsDBNull(4)) this.sHinhDaiDien = reader["sHinhDaiDien"].ToString();
                if (!reader.IsDBNull(5)) this.bTrangChu = Convert.ToBoolean(reader["bTrangChu"]);
                if (!reader.IsDBNull(6)) this.bQuanLy = Convert.ToBoolean(reader["bQuanLy"]);
            }
            reader.Close();
            reader.Dispose();
        }
    }
}
